import torch
import torch.nn as nn
import numpy as np

def forward( x):
        mean = x.mean(axis=-1, keepdims=True)
        std = x.std(axis=-1, keepdims=True)
        return (x - mean) / (std )
# 构造输入数据
batch_size, input_size = 2, 3
x_train = np.array( [[1, 1, 1, 1, 1], [1, 3, 4, 5, 6], [1, 4, 5, 6, 7], [1, 5, 6, 7, 8], [1, 6, 7, 8, 9], [1, 6, 7, 8, 9]])

# 进行归一化
y = forward(x_train )

# 输出归一化后的结果
print(x_train )
print(y)